package com.cy.xrd.sms.util;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @title: SmsProperties
 * @Author Luo
 * @Date: 2021/7/14 上午 11:46
 * @Version 1.0
 */

@Data
@Component
@ConfigurationProperties(prefix = "tencentcloud.sms")
public class SmsProperties implements InitializingBean {
//    region-id: ap-beijing
//    app-id : 1400547621
//    key-id: AKIDvd5GBpCG5duvgJjtysXx7AxVotjLhofK
//    key-secret: TiiTyDDxRghSxBAsJTN1OUJsABvPddNz
//    template-code: 1034314
//    sign-name: 起飞12103

    private String regionId;
    private String appId;
    private String keyId;
    private String keySecret;
    private String templateCode;
    private String signName;

    public static String REGION_ID;
    public static String APP_ID;
    public static String KEY_ID;
    public static String KEY_SECRET;
    public static String TEMPLATE_CODE;
    public static String SIGN_NAME;

    @Override
    public void afterPropertiesSet() throws Exception {
        REGION_ID = regionId;
        APP_ID = appId;
        KEY_ID = keyId;
        KEY_SECRET = keySecret;
        TEMPLATE_CODE = templateCode;
        SIGN_NAME = signName;
    }
}